﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;

public partial class MyAdmin_Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
    }
 
    protected void Login1_LoggedIn(object sender, EventArgs e)
    {
        Helper.setCurrentAminUserName(Session, Login1.UserName);
        Helper.setCurrentAdminRole(Session, DataAccess_Layer.UserInRoleDAC.timRoleCuaUser(Login1.UserName));
        Session["MatKhau"] = Login1.Password;
        
        string wantedPage = Helper.getWantedPage(Session);
        if (wantedPage != null && wantedPage != Helper.getCurrentPageName(Request.Url))
        {
            Helper.setWantedPage(Session, null);
            Response.Redirect(wantedPage);
            return;
        }        
        Response.Redirect("Admin.aspx");
    }
}